home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d18
/
turbotut.arc
/
RECURSON.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1989-06-30
|
341b
|
17 lines
PROGRAM try_recursion;
VAR count : INTEGER;
PROCEDURE print_and_decrement(index : INTEGER);
BEGIN
WRITELN('The value of the index is ',index:3);
index := index - 1;
IF index > 0 THEN
print_and_decrement(index);
END;
BEGIN (* main program *)
count := 7;
print_and_decrement(count);
END. (* main program *)